package com.xcc.xccdiff;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;

public class Bzip2 {
    static {
        System.loadLibrary("native-lib");
    }

    public static String getApkFilePath(Context context, String packageName) {
        try {
            ApplicationInfo appInfo = context.getPackageManager()
                    .getApplicationInfo(packageName, 0);
            return appInfo.sourceDir;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }

        return null;
    }

    /**
     * xccDiff(getApkFilePath(Context, 包名),合并后存储新Apk的路径,差异文件的路径);
     */
    public native boolean xccDiff(String oldFile, String newFile, String patchFile);
}
